#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
// https://www.luogu.com.cn/problem/CF44C

const int N = 110;
int n, m;
int f[N];
int main()
{
	cin >> n >> m;
	int b, e;
	for (int i = 1; i <= m; ++i)
	{
		cin >> b >> e;
		if (b == e)f[b]++;
		else
		{
			for (int j = b; j <= e; ++j)
				f[j]++;
		}
	}


	for (int i = 1; i <= n; ++i)
	{
		if (f[i] != 1)
		{
			cout << i << ' ' << f[i] << endl;
			return 0;
		}

	}
	cout << "OK" << endl;

	return 0;
}
